import React from 'react';
import { Spin } from 'antd';

export default function asyncComponent(LazyComponent, fallback = <Spin/>) {
  return props => {
    return (
      <React.Suspense fallback>
        <LazyComponent {...props} />
      </React.Suspense>
    );
  };
}
